package com.zkr.kfgs.mapper;

import com.zkr.kfgs.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import javax.validation.Valid;
import java.util.List;

/**
 *Created by lenovo on 2021/01/14.
 */
@Mapper
public interface KFGSMapper {
    int queryCount(KFGSSelectVo kfgsSelectVo);


    List<KFGSVo> queryPage(KFGSSelectVo kfgsSelectVo);

    @Select("select * from kuwei where kqcode=#{kqcode}")
    List<KuWeiVo> queryKuWei(String kqcode);

    void updateStatus(KFGSVo kfgsVo);

    @Select("select legalPersonName,legalPersonId from legalperson")
    List<LegelPersonVo> ofCurrentUser();

    List<KFGSVo> queryWarehouse(KFGSVo kfgsVo);

    List<KFGSVo> queryCompanyStorageById(Integer id);

    @Select("select # from kuqu where wareHouseCode=#{wareHouseCode}")
    List<KQVo> queryKuqu(String wareHouseCode);


    List<KFGSVo> queryPositionId(@Valid List<KFGSAddVo> addLegal);

    void updateKong(@Valid List<KFGSAddVo> addLegal);

    void addUpdate(@Valid List<KFGSAddVo> addLegal);

    @Select("select * from kuwei where legalPersonId=#{legalPersonId}")
    List<KuWeiVo> querykq(Integer legalPersonId);

    @Select("select code,name from eulogy")
    List<EulogyVo> querykqsx();
    //判断库房id不能为空
    @Select("select * from warehouse where warehouseId=#{id}")
    KFVo queryByHouseId(@Valid KQVo kqVo);

    //根据库房id查询库区
    List<KQVo> queryByShuXing(@Valid KQVo kqVo);

    //判断库区属性id
    KQVo querySection(@Valid KQVo kqVo);


    List<Integer> querywarehouseIds(Integer legalPersonId);

    List<Integer> querykuqu(Integer legalPersonId);

    List<Integer> querykuwei(Integer legalPersonId);
}
